package galaxy.generator;

public class Generator
{
	private Grammar grammar;
	private Node state;
	
	public Generator(Grammar g, Node axiom)
	{
		this.grammar = g;
		this.state = axiom;
	}
	
	public Generator run()
	{
		grammar.transform(state);
		return this;
	}
	
	public Generator run(int times)
	{
		System.out.println("Running the generator for " + times + " rounds...");
		for (int i = 0; i < times-1; i++) {
			run();
		}
		System.out.println("Done!");
		return this;
	}
	
	public Node getState()
	{
		return state;
	}
}
